package triannon.client.components;

import java.awt.AlphaComposite;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;

import javax.swing.JPanel;

@SuppressWarnings("serial")
public class GlassPane extends JPanel{
	@Override
	protected void paintComponent(Graphics g) {
		Graphics2D g2d = (Graphics2D)g;
		BufferedImage bi = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_ARGB);
		Graphics2D tmpG = bi.createGraphics();
		super.paintComponent(tmpG);
		tmpG.dispose();
		
		g2d.setComposite(AlphaComposite.getInstance( AlphaComposite.DST_IN, 0.4f ));
		g2d.drawRenderedImage(bi, null);
	}
}
